home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue25 / clinic / STATICU2.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1997-06-03  |  773 b   |  47 lines

  1. unit StaticU2;
  2.  
  3. interface
  4.  
  5. type
  6.   TStatic = class(TObject)
  7.   public
  8.     AnObjectField: Integer;
  9.     class function GetAClassField: Integer;
  10.     class procedure SetAClassField(Value: Integer);
  11.  
  12.     procedure AnObjectMethod;
  13.     class procedure AClassMethod;
  14.   end;
  15.  
  16.   TStaticClass = class of TStatic;
  17.  
  18. implementation
  19.  
  20. uses
  21.   Dialogs;
  22.  
  23. const
  24.   StaticField: Integer = 0;
  25.  
  26. class function TStatic.GetAClassField: Integer;
  27. begin
  28.   Result := StaticField
  29. end;
  30.  
  31. class procedure TStatic.SetAClassField(Value: Integer);
  32. begin
  33.   StaticField := Value
  34. end;
  35.  
  36. class procedure TStatic.AClassMethod;
  37. begin
  38.   ShowMessage('This is a class method')
  39. end;
  40.  
  41. procedure TStatic.AnObjectMethod;
  42. begin
  43.   ShowMessage('This is an object method')
  44. end;
  45.  
  46. end.
  47.